export default {
  namespaced: true,
  state: {
    sidebar: {
      defaultActive: '',
      tree: [
        {
          icon: 'el-icon-menu',
          title: '一拼通',
          subs: [
            {title: '车辆跟踪', path: ''},
            {title: '常用查询', path: ''},
          ]
        },
        {
          icon: 'el-icon-menu',
          title: '调度作业',
          subs: [
            {title: '业务录入', path: '/system?businessEntry'},
            {title: '调度派车', path: '/system?businessEntry'},
            {title: '预配查询', path: ''},
            {title: '外发确认', path: ''},
          ]
        },
        {
          icon: 'el-icon-menu',
          title: '财务管理',
          subs: [
            {title: '应收费用', path: ''},
            {title: '应付费用', path: ''},
            {title: '车辆成本', path: ''},
            {title: '应收核销', path: ''},
            {title: '应付核销', path: ''},
            {title: '日常开销', path: ''},
          ]
        },
        {
          icon: 'el-icon-menu',
          title: '统计报表',
          subs: [
            {title: '客户对账单', path: ''},
            {title: '业务汇总', path: ''},
            {title: '司机业务汇总', path: ''},
            {title: '单车业务汇总', path: ''},
            {title: '外发业务汇总', path: ''},
            {title: '应收汇总', path: ''},
            {title: '应付汇总', path: ''},
            {title: '利润分析汇总', path: ''},
          ]
        },
        {
          icon: 'el-icon-menu',
          title: '基础数据',
          subs: [
            {title: '客户管理', path: ''},
            {title: '门点地址', path: ''},
            {title: '寄单点管理', path: ''},
            {title: '费用项设置', path: ''},
            {title: '合作伙伴', path: ''},
            {title: '我的司机', path: ''},
          ]
        },
        {
          icon: 'el-icon-menu',
          title: '用户管理',
          subs: [
            {title: '银行卡管理', path: ''},
            {title: '企业信息', path: ''},
          ]
        }
      ]
    }
  },
  mutations: { },
  actions: {
    initWeb ({dispatch}) {
      dispatch('user/initUser', {}, {root: true}).then(next => {
        if (next) {
          dispatch('socket/initChat', {}, {root: true})
        }
      })
    }
  }
}
